<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018-08-06
 * Time: 14:07
 */

namespace App\Http\Controllers\Account;


use App\Http\Controllers\Controller;
use App\Http\Controllers\Validator\AdminVail;
use App\Model\Account\CreateTable;
use App\Tool\Error;
use Illuminate\Http\Request;

class CreateTableController extends Controller
{
    //创建客源表
    public function createCustomers(Request $request)
    {
        $params = $request->all();
        $vali   = AdminVail::create($params);
        if (!$vali) {
            return $this->error(Error::PARAM_MISSING);
        }
        $status = CreateTable::createCustomers($params['c_id']);
        if (!$status) {
            return $this->error(Error::CREATE_TABLE_ERROR);
        }
        return $this->success('ok', '创建成功');
    }


}